<?php
require_once("../../inc/global.php");
require_once("function.php");
adminislogin();
$MenuID=$_GET["MenuID"];
$id=$_GET["id"];
if(is_numeric($id))
{
	if(empty($MenuID)){
		$TableName="menusys";
	}
	else{
		$TableName_temp=$db->getoners("select menusys8 from menusys where menusys0={$MenuID} order by menusys0 desc limit 1");
		$TableName=$TableName_temp[0];
	}
	$deletesql="delete from {$TableName} where {$TableName}0={$id}";
	if($db->query($deletesql)){
		if(strtolower($TableName)=='menusys'){
			YKT_refresh_path("../../left.php"); //刷新左边
		}
		//$base->alert("删除成功",0,$_SERVER["HTTP_REFERER"]);
		YKT_error('删除成功！！',$_SERVER["HTTP_REFERER"]);
	}
	else{
		//$base->alert("删除失败",0,);
		YKT_error('删除失败！！',$_SERVER["HTTP_REFERER"]);
	}		
}
else
{
	//$base->alert("删除失败",0,$_SERVER["HTTP_REFERER"]);
	YKT_error('删除失败！！',$_SERVER["HTTP_REFERER"]);
}
?>
